let _tool = {
	// 读取书籍内容
	async getBookContent (sourceCode, startStr, endStr) {
		uni.showLoading({
			title: '处理中。。。'
		})
		let content = await this.interceptSpecificString(sourceCode, startStr, endStr)
		uni.hideLoading()
		return content
	},
	
	// 截取特定字符串
	async interceptSpecificString (sourceCode, startStr, endStr) {
		
		if (sourceCode == "" || sourceCode == null || sourceCode == undefined) {
			return ""
		}
		var startIndex = sourceCode.indexOf(startStr)
		if (startIndex < 0) {
			return ""
		}
		
		// 从开始字符串截取到末尾
		var str = sourceCode.substring(startIndex + startStr.length)
		
		// 从开始截取到结束字符串为止
		return str.substring(0, str.indexOf(endStr))
	},
	
}

export default _tool